export default function bindPwa() {
	window.deferredPrompt = null;
	window.addEventListener('beforeinstallprompt', e => {
		e.preventDefault();
		window.deferredPrompt = e;
	});
	window.deferredPromptClick = function () {
		window.deferredPrompt.prompt();
		window.deferredPrompt.userChoice.then(choiceResult => {
			if (choiceResult.outcome === 'accepted') {
				window.deferredPrompt = null;
				localStorage.setItem('kayaPwaCloseNum', '10001');
			}
		});
	};
}
